package com.fenghongzhang.day0122;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class MyReceiver3 extends BroadcastReceiver {


    private static final String TAG = "MyReceiver3";
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if(action.equals("android.intent.action.USER_PRESENT")){
            Log.i(TAG, "onReceive: 开屏");
        }else if(action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)){
            Log.i(TAG, "onReceive: 飞行模式变化.");
        }
    }
}
